<?php
/**
 * Created by PhpStorm.
 * User: lyang
 * Date: 2016/12/31
 * Time: 12:30
 */
defined("APP_NAME") or define("APP_NAME","app");
define("LIB_PATH",ROOT."/lib");
require_once LIB_PATH."/YC.php";

YC::bind("DB",function(){#数据库
    require_once LIB_PATH."/DB.php";
    $database = new   DB([
        'database_type' => 'mysql',
        'database_name' => 'y_cms',
        'server'        => 'localhost',
        'username'      => 'root',
        'password'      => 'root',
        'charset'       => 'utf8'
    ]);
    return $database;
});
YC::bind("Middleware",function(){#中间件
    require_once LIB_PATH."/Middleware.php";
    return new  Middleware();
});
YC::bind("Cache",function(){#Cache类 
    require_once LIB_PATH."/Cache.php";
    return new  Cache(ROOT."/public/tmp");
});
YC::bind("Crypt",function(){#加密类
    require_once LIB_PATH."/Crypt.php";
    return new  Crypt();
});
YC::bind("Router",function(){#路由
    require_once LIB_PATH."/Router.php";
    return new  Router();
});
YC::bind("Model",function(){#模型
    require_once LIB_PATH."/Model.php";
    return new  Model();
});

YC::set("ROOT","http://cms.yangakw.cn/");